package com.sun.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 订单信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("enhance_product")
public class EnhanceProduct {
    @TableId(value = "pid", type = IdType.AUTO)
    private Integer pId;

    @NotBlank(message = "产品名称不能为空!")
    @TableField("pname")
    private String name;

    @DecimalMin(value = "0",message = "产品金额最小值不能小于0")
    @TableField("price")
    private String price;

    @Size(max = 15,message = "产品分类信息长度不能超过15")
    @TableField("category_name")
    private String categoryName;
}